{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-05-20T13:26:31.350677Z",
     "start_time": "2025-05-20T13:26:31.344244Z"
    }
   },
   "source": [
    "import numpy\n",
    "\n",
    "# 定义一个1*2的矩阵\n",
    "x = numpy.array([[1, 2]])\n",
    "\n",
    "x1 = 2 * x\n",
    "x2 = [[2], [2]] * x\n",
    "\n",
    "x1.shape, x2.shape, x1, x2"
   ],
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((1, 2),\n",
       " (2, 2),\n",
       " array([[2, 4]]),\n",
       " array([[2, 4],\n",
       "        [2, 4]]))"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 18
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
